#coding:utf8

from .. import common
import redis
import json
r = redis.Redis()
class KLineHandler(common.BaseHandler):
    def get(self, code):
        self.render('quote/k.html',code = code)
        
        
class KQueryHandler(common.BaseHandler):
    
    def get(self, code): 
        res = r.lrange('%s.day'%str(code), 0, -1)
        for i in range(len(res)):
            res[i] = eval(res[i])
        self.write(json.dumps(res))
         
        